<!DOCTYPE html>
<html>
  <head>
    <meta charset="UTF-8">
    <title>String跑马灯</title>
  </head>
  <body>
    <script>
        var str = " * * * 欢 迎 进 入 * * *";

        function run() {
            str = str.substring(1, str.length) + str.substring(0, 1);
            document.title = str;//在标题栏显示
        }

        setInterval("run()", 300);//每隔0.3秒调用一次run()
    </script>
  </body>
</html>
